#ifndef __MAIN_H_
#define __MAIN_H_

#include <WiFi.h>
#include <PubSubClient.h>
#include <SoftwareSerial.h>
#include <stdio.h>
#include "motor_car.h"
#include "line_pid.h"

#define u8 uint8_t
#define printSerial Serial
#define Package_size 100

extern int track_flag;
extern char send_buf[35];
extern uint8_t rx_buff[Package_size];
extern uint8_t new_package[Package_size];
extern uint8_t g_new_package_flag;
extern const int Press_KEY;
extern const int Release_KEY;
extern const char *mqtt_broker;
extern const char *mqtt_username;
extern const char *mqtt_password;
extern const int mqtt_port;

extern uint8_t x1, x2, x3, x4, x5, x6, x7, x8;

extern String mqtt_topic;
extern String mqtt_data;
extern boolean mqtt_status;
extern String project;
extern WiFiClient espClient;

void callback(char *topic, byte *payload, unsigned int length);
void uploadData(const char *subTopic, const char *payload);
void I2Cdata(void);

#endif